home *** CD-ROM | disk | FTP | other *** search
- unit ChildMainFormUnit;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TChildForm = class(TForm)
- Memo1: TMemo;
- procedure Memo1Change(Sender: TObject);
- private
- end;
-
- var
- ChildForm: TChildForm;
-
- implementation
-
- {$R *.DFM}
-
- procedure TChildForm.Memo1Change(Sender: TObject);
- var
- CopyData: TCopyDataStruct;
- TextMsg: String;
- begin
- TextMsg := Memo1.Text;
- //Make the data pointer point at the first character of the string
- CopyData.lpData := @TextMsg[1];
- //Set the length field to indicate the number of characters in the memo
- CopyData.cbData := Length(TextMsg);
- //Send the message to the parent's window handle, as sent on the command-line
- SendMessage(StrToInt(ParamStr(1)), wm_CopyData, Handle, Integer(@CopyData))
- end;
-
- end.